# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.PrivateCA.V1.Model.CertificateRevocationList do
  @moduledoc """
  A CertificateRevocationList corresponds to a signed X.509 certificate Revocation List (CRL). A CRL contains the serial numbers of certificates that should no longer be trusted.

  ## Attributes

  *   `accessUrl` (*type:* `String.t`, *default:* `nil`) - Output only. The location where 'pem_crl' can be accessed.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which this CertificateRevocationList was created.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Labels with user-defined metadata.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name for this CertificateRevocationList in the format `projects/*/locations/*/caPools/*certificateAuthorities/*/ certificateRevocationLists/*`.
  *   `pemCrl` (*type:* `String.t`, *default:* `nil`) - Output only. The PEM-encoded X.509 CRL.
  *   `revisionId` (*type:* `String.t`, *default:* `nil`) - Output only. The revision ID of this CertificateRevocationList. A new revision is committed whenever a new CRL is published. The format is an 8-character hexadecimal string.
  *   `revokedCertificates` (*type:* `list(GoogleApi.PrivateCA.V1.Model.RevokedCertificate.t)`, *default:* `nil`) - Output only. The revoked serial numbers that appear in pem_crl.
  *   `sequenceNumber` (*type:* `String.t`, *default:* `nil`) - Output only. The CRL sequence number that appears in pem_crl.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The State for this CertificateRevocationList.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which this CertificateRevocationList was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accessUrl => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :pemCrl => String.t() | nil,
          :revisionId => String.t() | nil,
          :revokedCertificates => list(GoogleApi.PrivateCA.V1.Model.RevokedCertificate.t()) | nil,
          :sequenceNumber => String.t() | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:accessUrl)
  field(:createTime, as: DateTime)
  field(:labels, type: :map)
  field(:name)
  field(:pemCrl)
  field(:revisionId)
  field(:revokedCertificates, as: GoogleApi.PrivateCA.V1.Model.RevokedCertificate, type: :list)
  field(:sequenceNumber)
  field(:state)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.PrivateCA.V1.Model.CertificateRevocationList do
  def decode(value, options) do
    GoogleApi.PrivateCA.V1.Model.CertificateRevocationList.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.PrivateCA.V1.Model.CertificateRevocationList do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
